import http from '../http'

// 分页查询入库单（后端为POST + JSON）
export function getReceiptList(data) {
  return http.post('/warehousing/warehouse/receipt/page', data)
}

// 获取入库单详情（/getDetail?id=）
export function getReceiptDetail(id) {
  return http.get('/warehousing/warehouse/receipt/getDetail', { params: { id } })
}

// 新增入库单
export function addReceipt(data) {
  return http.post('/warehousing/warehouse/receipt', data)
}

// 修改入库单
export function updateReceipt(data) {
  return http.put('/warehousing/warehouse/receipt', data)
}

// 删除入库单
export function deleteReceipt(ids) {
  return http.delete(`/warehousing/warehouse/receipt/${ids}`)
}

// 审核入库单
export function auditReceipt(id) {
  return http.put(`/warehousing/warehouse/receipt/audit/${id}`)
}

// 导出入库单
export function exportReceipt(params) {
  return http.get('/warehousing/warehouse/receipt/export', {
    params,
    responseType: 'blob'
  })
}
